<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>simvoc.input.datafilter</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="simvoc-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >SimVOC</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="simvoc-module.html">Package&nbsp;simvoc</a> ::
        <a href="simvoc.input-module.html">Package&nbsp;input</a> ::
        Module&nbsp;datafilter
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module datafilter</h1><p class="nomargin-top"><span class="codelink"><a href="simvoc.input.datafilter-pysrc.html">source&nbsp;code</a></span></p>
<p>Filtering functions for individual rows of input data, where each row 
  is a sequence (usually a list) of data items. These functions provide 
  simple intermediate processing capabilities.</p>

<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.input.datafilter-module.html#SEL_ALWAYS" class="summary-sig-name">SEL_ALWAYS</a>(<span class="summary-sig-arg">row</span>)</span><br />
      Simple row selector that always selects a row.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.input.datafilter-pysrc.html#SEL_ALWAYS">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.input.datafilter-module.html#SEL_NEVER" class="summary-sig-name">SEL_NEVER</a>(<span class="summary-sig-arg">row</span>)</span><br />
      Simple row selector that never selects a row</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.input.datafilter-pysrc.html#SEL_NEVER">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.input.datafilter-module.html#select_row" class="summary-sig-name">select_row</a>(<span class="summary-sig-arg">row</span>,
        <span class="summary-sig-arg">row_filter</span>)</span><br />
      Selects rows based on filtering criteria established by an external 
      function.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.input.datafilter-pysrc.html#select_row">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.input.datafilter-module.html#filter_row" class="summary-sig-name">filter_row</a>(<span class="summary-sig-arg">row</span>,
        <span class="summary-sig-arg">col_filter</span>)</span><br />
      Filters the columns of a row, returning a new row in filter order.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.input.datafilter-pysrc.html#filter_row">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.input.datafilter-module.html#data_filter" class="summary-sig-name">data_filter</a>(<span class="summary-sig-arg">row</span>,
        <span class="summary-sig-arg">row_filter</span>,
        <span class="summary-sig-arg">col_filter</span>)</span><br />
      Applies a row selector and column filter to an input row, returning 
      the filtered row (as a list) if selected, or None if either the row 
      was not selected or the row did not match any filters.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.input.datafilter-pysrc.html#data_filter">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">float</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.input.datafilter-module.html#timestamp_to_gmtime" class="summary-sig-name">timestamp_to_gmtime</a>(<span class="summary-sig-arg">stamp</span>,
        <span class="summary-sig-arg">fmt</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">%Y-%m-%d-%H:%M</code><code class="variable-quote">'</code></span>)</span><br />
      Converts a timestamp in a format recognizable by the date module into
      a floating-point value containing seconds since the epoch in UTC.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.input.datafilter-pysrc.html#timestamp_to_gmtime">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'simvoc.input'"><code class="variable-quote">'</code><code class="variable-string">simvoc.input</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
</table>
<p class="indent-wrapped-lines"><b>Imports:</b>
  <span title="time">time</span>,
  <span title="calendar">calendar</span>
</p><br />
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="SEL_ALWAYS"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">SEL_ALWAYS</span>(<span class="sig-arg">row</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.input.datafilter-pysrc.html#SEL_ALWAYS">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Simple row selector that always selects a row.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>row</code></strong> (sequence) - Row to select</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd>True</dd>
  </dl>
</td></tr></table>
</div>
<a name="SEL_NEVER"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">SEL_NEVER</span>(<span class="sig-arg">row</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.input.datafilter-pysrc.html#SEL_NEVER">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Simple row selector that never selects a row</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>row</code></strong> (sequence) - Row to select</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd>False</dd>
  </dl>
</td></tr></table>
</div>
<a name="select_row"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">select_row</span>(<span class="sig-arg">row</span>,
        <span class="sig-arg">row_filter</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.input.datafilter-pysrc.html#select_row">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Selects rows based on filtering criteria established by an external 
  function. The row filter may be a function or a tuple. If a function is 
  used, the function will be invoked with a single argument: the row 
  itself. When a tuple is specified, the function to be invoked will be the
  first item in the tuple. The first argument to the function will be the 
  row, followed by the remaining tuple items as verbatim arguments.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>row</code></strong> (sequence) - Row to test</li>
        <li><strong class="pname"><code>row_filter</code></strong> - Row filter (function or tuple)</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd>True if the row has been accepted, False if it has been rejected</dd>
  </dl>
</td></tr></table>
</div>
<a name="filter_row"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">filter_row</span>(<span class="sig-arg">row</span>,
        <span class="sig-arg">col_filter</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.input.datafilter-pysrc.html#filter_row">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Filters the columns of a row, returning a new row in filter order. If 
  the row does not match the filter, None is returned. In the event the 
  filter is None, a shallow copy of the row is returned.</p>
  <p>The column filter must be a sequence (nominally a tuple). Each item in
  the sequence constitutes a filter to match. An integer item matches a 
  column number in the row (yielding Exceptions in case of invalid 
  numbers). If a tuple is used as an item in the outer sequence, then the 
  first item of the inner tuple is invoked as a function, passing the row, 
  followed by the remaining tuple items, as arguments. Finally, any 
  non-int, non-tuple type is treated as a function invoked with a single 
  argument: the row itself. Any such function must return the verbatim item
  to be included in the filtered row, or None if nothing should be 
  inserted.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>row</code></strong> (sequence) - Row to be filtered</li>
        <li><strong class="pname"><code>col_filter</code></strong> - Filter sequence as described above</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a newly filtered row as a list, or None if no filters match</dd>
  </dl>
</td></tr></table>
</div>
<a name="data_filter"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">data_filter</span>(<span class="sig-arg">row</span>,
        <span class="sig-arg">row_filter</span>,
        <span class="sig-arg">col_filter</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.input.datafilter-pysrc.html#data_filter">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Applies a row selector and column filter to an input row, returning 
  the filtered row (as a list) if selected, or None if either the row was 
  not selected or the row did not match any filters.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>row</code></strong> (sequence) - Input row</li>
        <li><strong class="pname"><code>row_filter</code></strong> - Row selector (see <a 
          href="simvoc.input.datafilter-module.html#select_row" 
          class="link">select_row</a> method)</li>
        <li><strong class="pname"><code>col_filter</code></strong> - Column filter (see <a 
          href="simvoc.input.datafilter-module.html#filter_row" 
          class="link">filter_row</a> method)</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a filtered row (as a list) or None</dd>
  </dl>
</td></tr></table>
</div>
<a name="timestamp_to_gmtime"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">timestamp_to_gmtime</span>(<span class="sig-arg">stamp</span>,
        <span class="sig-arg">fmt</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">%Y-%m-%d-%H:%M</code><code class="variable-quote">'</code></span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.input.datafilter-pysrc.html#timestamp_to_gmtime">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Converts a timestamp in a format recognizable by the date module into 
  a floating-point value containing seconds since the epoch in UTC.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>stamp</code></strong> (str) - Input timestamp</li>
        <li><strong class="pname"><code>fmt</code></strong> (str) - Format of timestamp, supported by calendar module</li>
    </ul></dd>
    <dt>Returns: float</dt>
        <dd>floating-point time representation (UTC seconds)</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="simvoc-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >SimVOC</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0 on Fri Oct 23 11:04:28 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
